﻿using System;
using System.Windows.Forms;

namespace InvoiceManagement.Forms
{
  public partial class MainForm : Form
  {
    public MainForm()
    {
      InitializeComponent();
    }

    private void OnAddEmployeeClicked(object sender, EventArgs e)
    {
      EmployeeDetails emp = new EmployeeDetails();
      DialogResult result = emp.ShowDialog();
    }

    private void OnExitClick(object sender, EventArgs e)
    {
        this.Close();
    }

    //protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
    //{
    //  if (MessageBox.Show("Are you sure want to close the application ?", "Inventory Management", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
    //    e.Cancel = true;
    //  base.OnClosing(e);
    //}

    private void OnAddCompanyClick(object sender, EventArgs e)
    {
      CompanyDetails companydetails = new CompanyDetails();
      companydetails.ShowDialog();
    }

    private void OnAddJobClick(object sender, EventArgs e)
    {
      JobDetails job = new JobDetails();
      job.ShowDialog();
    }

    private void viewDetailsToolStripMenuItem_Click(object sender, EventArgs e)
    {
      ViewEmployeeDetails empInfo = new ViewEmployeeDetails();
      empInfo.ShowDialog();
    }
  }
}
